package servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.IOException;

public class ForwardServlet2 extends HttpServlet {
    private static final long serialVersionUID = 2453203320942277471L;

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ServletContext app = req.getServletContext();
        String path = "/WEB-INF/forwarded/result2.jsp";
        // 为请求设置属性
        req.setAttribute("page-path", path);
        RequestDispatcher dispatcher = app.getRequestDispatcher(path);
        dispatcher.forward(req, resp);
    }
}
